<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var score = +prompt("输入学生的成绩");

        /*方法一*/
        switch (parseInt(score/10)) {
            case 6:
            case 7:
            case 8:
            case 9:
            case 10:
                console.log("合格");            
                break;
        
            default:
                console.log("不合格");
                break;
        }

        /*方法二*/
        switch (true) {
            case score>=60:
                console.log("合格");
                break;
        
            default:
                console.log("不合格");
                break;
        }
    </script>
</head>
<body>
    
</body>
</html>